import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'index',
      component: () => import('../views/index.vue'),
    },
    {
      path: '/video',
      name: 'video',
      component: () => import('../views/video.vue'),
    },
    {
      path: '/post',
      name: 'post',
      component: () => import('../views/post.vue'),
    },
    {
      path: '/message',
      name: 'message',
      component: () => import('../views/message.vue'),
    },
    {
      path: '/mine',
      name: 'mine',
      component: () => import('../views/mine.vue'),
    },
    {
      path: '/login',
      name: 'login',
      component: () => import('../views/login.vue'),
    },
    {
      path: '/article/:id',
      name: 'articleDetail',
      component: () => import('../views/article/detail.vue')
    },
    {
      path: '/rank',
      name: 'Rank',
      component: () => import('@/views/rank.vue')
    },
    {
      path: '/article/list',
      name: 'ArticleList',
      component: () => import('@/views/article/list.vue')
    },
    {
      path: '/user/profile',
      name: 'UserProfile',
      component: () => import('@/views/user/profile.vue')
    },
    {
      path: '/scenic',
      children: [
        {
          path: '',
          name: 'ScenicList',
          component: () => import('@/views/scenic/list.vue')
        },
        {
          path: ':id',
          name: 'ScenicDetail',
          component: () => import('@/views/scenic/detail.vue')
        }
      ]
    },
    {
      path: '/order',
      children: [
        {
          path: 'create',
          name: 'OrderCreate',
          component: () => import('@/views/order/create.vue')
        },
        {
          path: 'detail/:id',
          name: 'OrderDetail',
          component: () => import('@/views/order/detail.vue')
        }
      ]
    },
    {
      path: '/user/follow',
      name: 'UserFollow',
      component: () => import('@/views/user/follow.vue')
    },
    {
      path: '/user/fans',
      name: 'UserFans',
      component: () => import('@/views/user/fans.vue')
    },
    {
      path: '/user/friends',
      name: 'UserFriends',
      component: () => import('@/views/user/friends.vue')
    },
    {
      path: '/chat/:id',
      name: 'Chat',
      component: () => import('@/views/chat/index.vue')
    },
    {
      path: '/parse',
      name: 'Parse',
      component: () => import('@/views/parse.vue')
    },
    {
      path: '/friend-circle',
      name: 'FriendCircle',
      component: () => import('@/views/friend-circle.vue')
    },
    {
      path: '/notes',
      name: 'Notes',
      component: () => import('@/views/notes.vue')
    },
    {
      path: '/strategy',
      name: 'Strategy',
      component: () => import('@/views/strategy.vue')
    },
    {
      path: '/points',
      name: 'Points',
      component: () => import('@/views/points.vue')
    },
    {
      path: '/accompany',
      name: 'Accompany',
      component: () => import('@/views/accompany.vue')
    },
    {
      path: '/accompany/:id',
      name: 'AccompanyDetail',
      component: () => import('@/views/accompany/detail.vue')
    },
    {
      path: '/accompany/my',
      name: 'AccompanyMy',
      component: () => import('@/views/accompany/my.vue')
    },
    {
      path: '/ai',
      name: 'AI',
      component: () => import('@/views/ai.vue')
    },
    {
      path: '/admin',
      component: () => import('@/layout/admin/index.vue'),
      children: [
        {
          path: 'user',
          children: [
            {
              path: 'index',
              component: () => import('@/views/admin/user/index.vue')
            }
          ]
        },
        {
          path: '/admin/profile',
          component: () => import('@/views/admin/user/profile.vue'),
          meta: {
            requiresAuth: true,
            title: '个人信息'
          }
        }
        // ... 其他路由配置
      ]
    },
    {
      path: '/admin/login',
      name: 'AdminLogin',
      component: () => import('@/views/admin/login.vue')
    },
    
  ],
})

export default router